Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow JOY_AXIS_INVALID in InputEventJoypadMotion's axis #97068

Merged
merged 1 commit into from
Sep 18, 2024

Conversation

Mickeon
Copy link
Contributor

@Mickeon Mickeon commented Sep 16, 2024

@akien-mga
Copy link
Member

Makes sense, but I notice that InputEventJoypadButton::set_button_index (also mentioned in that proposal) doesn't do any validation of the parameter. Actually, almost none of the setters in InputEvent* classes do, aside from this one.

@Mickeon
Copy link
Contributor Author

Mickeon commented Sep 16, 2024

Makes me wonder if there should be parameters checking in the first place. It seems none of the InputEvent's business to question these values. If one were obsessed with performance, they could argue it even makes Godot's own created events a bit slower.

@JulianHeuser
Copy link
Contributor

JulianHeuser commented Sep 16, 2024

If it helps, the only reference to this error message I found online was someone confused because they were getting it and didn't know why (was just ERR_FAIL_INDEX at the time so it's slightly different): https://forum.godotengine.org/t/joy-axis-error-debug-spam/5634

The check was added here: 41c1cfe

Copy link
Contributor

@Sauermann Sauermann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm inclined to believe, that this change makes sense.

The idea of consolidating parameter validation for input events would probably be a discussion for a different PR/Issue.

@akien-mga akien-mga modified the milestones: 4.x, 4.4 Sep 18, 2024
@akien-mga akien-mga changed the title Allow JOY_AXIS_INVALID in InputEventJoypadMotion's axis Allow JOY_AXIS_INVALID in InputEventJoypadMotion's axis Sep 18, 2024
@akien-mga akien-mga merged commit d8a82a8 into godotengine:master Sep 18, 2024
20 checks passed
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow InputEventJoypadMotion to have an Invalid Axis without error messages.
4 participants